package com.tongtech.space.controller.common;

import com.tongtech.space.common.constants.Constants;
import com.tongtech.space.common.pojo.Result;
import com.tongtech.space.common.pojo.UserInfo;
import com.tongtech.space.common.utils.SysUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 基础controller
 *
 * @author jiayu
 * @since 2020/12/25
 */
@Slf4j
@RestController
@RequestMapping(Constants.URL_API_VERSION + "/base")
@Api(tags = "基础接口")
public class BaseController {

    /**
     * 获取当前用户信息
     *
     * @author jinjiayu
     */
    @ApiOperation(value = "获取当前用户信息")
    @GetMapping("/getUserInfo")
    public Result getUserInfo() {
        UserInfo userInfo = SysUtils.getUserInfo();
        return Result.successSingle(userInfo);
    }


}
